
const successResponse = (res, data, code = 200) => {
  res.status(code).json({
    code,
    data,
    errMessage: null
  });
};

const errorResponse = (res, errMessage, code = 500, data = null) => {
  res.status(code).json({
    code,
    data,
    errMessage
  });
};

module.exports = {
  successResponse,
  errorResponse
};